﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:Agency_Count三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class Agency_CountService
	{
		 
	 
			
		public static int DeleteAgency_CountById(long id)	
		{     
            Agency_Count agency_Count = new Agency_Count();
            agency_Count.Id = id;
            EntityQuery<Agency_Count> query = new EntityQuery<Agency_Count>(agency_Count);
             return query.Delete(agency_Count);
		}	
        
          //以标识列获得对象
        public static Agency_Count GetAgency_CountById(long  id)
        {
            Agency_Count agency_Count = new Agency_Count();
            agency_Count.Id = id;
            EntityQuery<Agency_Count> query = new EntityQuery<Agency_Count>(agency_Count);
            query.FillEntity(agency_Count);
            return agency_Count;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateAgency_Count(Agency_Count agency_Count)
        {
            Agency_Count _agency_Count = new Agency_Count();

            EntityQuery<Agency_Count> query = new EntityQuery<Agency_Count>(_agency_Count);
           _agency_Count= agency_Count;
           int i=(agency_Count.Id==0)?
                 query.Insert(_agency_Count): query.Update(_agency_Count);
            return i;
        }
		
		 
	}
}

